Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: replace QString() with QStringLiteral() for better performance #7422

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

Integral-Tech
Copy link

No description provided.

@Integral-Tech Integral-Tech force-pushed the qstring-refactor branch 2 times, most recently from 6e4bc82 to bb6a140 Compare October 28, 2024 15:15
@claucambra claucambra added this to the 3.16.0 milestone Nov 22, 2024
@Integral-Tech
Copy link
Author

@claucambra Would you like to approve my PR?

const auto serverDisplayString = QStringLiteral("%1 (%2)").arg(serverName, serverUrl);
_ui.comboBox->addItem(serverDisplayString, serverUrl);
_ui.comboBox->addItem(serverName, serverUrl);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just curious - why this change?

Copy link
Author

@Integral-Tech Integral-Tech Dec 17, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

QStringLiteral() constructs the QString object during compilation, which avoids the runtime overhead of constructing QString objects.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants